package
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.display.LoaderInfo;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.utils.getTimer;
	
	public class mallsim extends Sprite
	{
		private var m_game:Game;
		private var m_lastTick:int;
		public function mallsim()
		{
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.frameRate = 30;
			Game.stage = stage;
			new Terminal(stage, onTerminalInput);
			m_game = new Game(this);
			m_lastTick = getTimer();
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
			Game.instance = m_game;
			
		}
		
		private function onEnterFrame(e:Event):void{
			var curTick:int = getTimer();
			var delta:int = curTick - m_lastTick;
			m_game.step(delta);
			m_lastTick = curTick;
		}
		
		private function onTerminalInput(input:String):void{

		}
	}
}